<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var str = 'aaabbbbaaa';

        function isSame(strs) {
            if (strs.length % 2 == 1) {
                return false;
            } else {
                for (var i = 0; i < strs.length / 2; i++) {
                    if (strs.charAt(i) != strs.charAt(strs.length - i - 1)) {
                        return false;
                    }
                }
            }
            return true;
        }
        alert(isSame(str))// true  结果为true，说明str是对称字符串
    </script>
</head>
<body>

</body>
</html>